import isValidKey from "./isValidKey";
export function getInterfaceRoute(name: string) {
  if(isValidKey(name, interfaceRoute)) {
    return interfaceRoute[name];
  }
  else {
    throw console.error();
  }
}

const URL = {
  develop: 'https://qmdd.gf41.gfinter.net/admin/qmdd2018/',
  product: 'https://gdyjydrd.com/fishing_back/',
  local: 'http://127.0.0.1/csm_local/',
  local2: 'http://127.0.0.1/fishing_back/',
}
export const url = URL.develop;
export const url2 = URL.product;
// 开发环境
const ENV = url + '/index.php?r=';
const ENV2 = url2 + '/index.php?r=';
export const filePath1 = 'https://upload.gfinter.net/';
// 选择环境
const DOMAIN = ENV;
//接口地址
const interfaceRoute = {
  getGameList:ENV+'io_api/get_game_list',
  getGameDetail:ENV+'io_api/game_detail',
  uploadPic:ENV+'io_api/uppic',
  createGame:ENV+'io_api/create_game',
  login:ENV2+'User/wxLogin',
  userUpdate:ENV2+'User/userUpdate',
  test:ENV+'io_api/third_login',
  getGameDetailRule:ENV+'io_file/game_rule',
  //
  expComList:ENV2+'io_game/gameList',
  addClub:ENV+'io_api/add_club',
  joinGame:ENV+'io_api/apply_join_game',
  joinGameRevoke:ENV+'io_api/revoke_join_game',//
  saveDraw:ENV2+'io_game/saveDraw',
  getDraw:ENV2+'io_game/getDraw',
  exportDraw:ENV2+'io_game/exportDraw',
  exportDraw2:ENV2+'io_game/exportDraw2',
  importPlayer:ENV2+'io_game/importPlayer',
  joiner_list:ENV+'io_api/get_game_project_joiner_list',//
  club_apply_detail:ENV+'io_api/get_club_apply_detail',
  addClub_record_apply_id:ENV2+'io_game/addClub_record_apply_id',
  club_login:ENV+'io_api/club_login',
  activity_list:ENV+"io_api/get_activity_list",
  activity_detail:ENV+"io_api/Get_activity_detail",
  create_activity:ENV+"io_api/Create_activity",
  join_activity:ENV+"io_api/Apply_join_activity",
  subscribe:ENV+"io_api/set_attention",
  region_list:ENV+"io_api/Get_region_list",
  getFollowClub:ENV+'io_api/Get_attention_club_list',
  downLoadComTem:ENV2+'io_game/DownLoadImportTem',
  getScore:ENV2+'io_game/getScore',
  writeScore:ENV2+'io_game/writeScore',
  getClubList:ENV+'io_api/Get_club_list',
  revoke_join_activity:ENV+'io_api/Revoke_join_activity',
  //轮播图
  getSlide:ENV2+'swiperimage/WxGetAllImage',
  getGrid:ENV2+'gridIcon/GetImage',
  get_club_agreement:ENV+'io_api/get_club_agreement',
}//
export const CURRENT_DOMAIN = DOMAIN; // 当前服务器URL